Refactor power policy to use direct async calls with power devices#553
Conversation
1588510 to
aa3e2e0
Compare
Cargo Vet Audit Passed
|
cda7d9a to
3467d89
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the power policy service architecture to use direct async calls instead of deferred IPC patterns. It introduces a proxy pattern for power device communication, extracts service message types into dedicated crates for better modularity, and adds comprehensive test coverage for the power policy service.
Changes:
- Refactors power policy to use direct async communication with devices via a proxy pattern
- Extracts thermal, debug, and battery service message types into separate reusable crates
- Implements MCTP relay infrastructure in embedded-services for message routing
- Adds test coverage for power policy consumer flows
Reviewed changes
Copilot reviewed 26 out of 32 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| type-c-service/src/wrapper/proxy.rs | New proxy pattern for power device communication channels |
| power-policy-service/src/*.rs | Refactored to use direct device trait calls instead of action state machine |
| thermal-service-messages/ | New crate containing thermal service request/response types |
| debug-service-messages/ | New crate containing debug service request/response types |
| battery-service-messages/ | New crate containing battery service request/response types |
| embedded-service/src/relay/ | New MCTP relay infrastructure for message serialization |
| embedded-service/src/event.rs | New event sender/receiver traits |
| embedded-service/src/power/policy/device.rs | Refactored device with InternalState and DeviceTrait |
| espi-service/src/mctp.rs | MCTP relay implementation using new infrastructure |
| power-policy-service/tests/ | New test files for consumer flows |
| examples/std/src/bin/*.rs | Updated examples for new architecture |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4be5bff to
a838d81
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 38 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d3aa53a to
57c10a6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 40 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
57c10a6 to
fbe2f13
Compare
fbe2f13 to
fd95083
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 40 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
31b3b00 to
69a1d6b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 45 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bbc2ee1 to
d29f8b6
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 45 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
97c2fe1 to
da6465a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 48 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1e56d48 to
c364a43
Compare
c364a43 to
ea9c6d9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 48 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* Move away from type-state type machine * Introduce first proper integration test * Create temporary bridge with type-C code
ea9c6d9 to
be39e10
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 33 out of 47 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DeviceTraittrait.impl DeviceTraitinstead of using channelstype_c_service::wrapper::proxy).